<template>
	<view>
		<view class="itemBox">
			<view class="item" v-if='item.status==status' v-for="(item,index) in list">
				
				<view class="right">
					<view class="top">
						<text class="name">{{item.name}}</text>
						<text class="tel">{{item.mobile}}</text>
					</view>
					<view class="bumen">{{item.department}}</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
		var http = require("../../../utils/http.js");
	export default {
		data(){
			return {
				list:[],
				status:null
			}
		},
		onLoad(option){
			console.log(option.index=='1')
			if(option.index=='1'){
				uni.setNavigationBarTitle({
					title:'已录提报人'
				})
			}else if(option.index=='2'){
				this.status=1
				uni.setNavigationBarTitle({
					title:'已提报'
				})
			}else{
				this.status=0
				uni.setNavigationBarTitle({
					title:'未提报'
				})
			}
			this.id=option.id
		},
		onShow(){
			this.getLsit()
		},
		methods:{
			getLsit(){
				var param = {
					url: "/p/cp/"+this.id+"/spInfoAndCount",
					method: "GET",
					data: {},
					callBack: res => {
						this.list=res.cpSubmitPersonInfoAndSubmitStatusList
					}
				};
				http.request(param);
			}
		}
	}
</script>

<style lang="scss">
	view,text {
		line-height: 1;
		box-sizing: border-box;
	}
	.itemBox {
		padding: 20rpx 0;
	}
	
	.item {
		border: 1rpx solid #c8c7cc;
		border-radius: 4px;
		width: 690rpx;
		margin: 0 auto;
		padding: 20rpx;
		display: flex;
		align-items: center;
	
		margin-bottom: 20rpx;
		.left {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100rpx;
		}
	
		.right {
			display: flex;
			flex-direction: column;
	
			.top {
				display: flex;
				margin-bottom: 30rpx;
	
				.name {
					margin-right: 100rpx;
				}
			}
		}
	}
</style>
